package com.entor.hqj.main;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;

import com.entor.hqj.login.R;
import com.entor.hqj.util.MoreTextView;
import com.entor.hqj.util.TitleBuilder;

public class ItemInfoActivity extends AppCompatActivity {

    private MoreTextView et_title;
    private MoreTextView et_content;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_item_info);

        et_title = (MoreTextView)findViewById(R.id.et_title);
        et_content = (MoreTextView)findViewById(R.id.et_content);

        initTitle();
        initData();


    }

    private void initTitle(){
        new TitleBuilder(this).setLeftText("返回").setMidTitleText("详细信息")
                .setLeftImgOrTextListener(new leftImgOrTextListener());
    }
    class leftImgOrTextListener implements View.OnClickListener{

        @Override
        public void onClick(View view) {
            finish();
        }
    }

    public void initData(){
        Intent intent = getIntent();
        String name = intent.getStringExtra("name");
        String content = intent.getStringExtra("content");

        et_title.setText(name);
        et_content.setText(content);
    }
}
